$(document).ready(function () {
    var lineChart = echarts.init(document.getElementById("echarts-pie-chart"));
    var lineoption = {
        title : {
            text: '',
            subtext: ''
            
        },
        tooltip : {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            orient: 'vertical',
            left: 'left',
            data: ['水源一','水源二','水源三','水源四','水源五']
        },
        // color:['#1ab394', '#ed5565','#ed5740','#F5F5F5','#1ab450'] ,    
        series : [
            {
                name: '来源',
                type: 'pie',

                radius : '55%',
                center: ['50%', '50%'],
                data:[
                    {value:335, name:'水源一'},
                    {value:310, name:'水源五'},
                    {value:234, name:'水源二'},
                    {value:135, name:'水源三'},
                    {value:1548, name:'水源四'}
                ],
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    lineChart.setOption(lineoption);
    var twoChart = echarts.init(document.getElementById("echarts-pie-chart-two"));
    var twooption = {
        title : {
            text: '',
            subtext: ''
            
        },
        tooltip : {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            orient: 'vertical',
            left: 'left',
            data: ['水源一','水源二','水源三']
        },
            
        series : [
            {
                name: '来源',
                type: 'pie',

                radius : '55%',
                center: ['50%', '50%'],
                data:[
                    {value:335, name:'水源一'},
                    {value:234, name:'水源二'},
                    {value:135, name:'水源三'}
                ],
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    twoChart.setOption(twooption);
    var threeChart = echarts.init(document.getElementById("echarts-pie-chart-three"));
    var threeoption = {
        title : {
            text: '',
            subtext: ''
            
        },
        tooltip : {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            orient: 'vertical',
            left: 'left',
            data: ['水源一','水源二']
        },
            
        series : [
            {
                name: '来源',
                type: 'pie',

                radius : '55%',
                center: ['50%', '50%'],
                data:[
                    {value:335, name:'水源一'},
                    
                    {value:234, name:'水源二'}
                ],
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    threeChart.setOption(threeoption);
    var fourChart = echarts.init(document.getElementById("echarts-pie-chart-four"));
    var fouroption = {
        title : {
            text: '',
            subtext: ''
            
        },
        tooltip : {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            orient: 'vertical',
            left: 'left',
            data: ['水源一','水源二','水源三','水源四']
        },
            
        series : [
            {
                name: '来源',
                type: 'pie',

                radius : '55%',
                center: ['50%', '50%'],
                data:[
                    {value:335, name:'水源一'},
                    {value:234, name:'水源二'},
                    {value:135, name:'水源三'},
                    {value:1548, name:'水源四'}
                ],
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    fourChart.setOption(fouroption);
    $("#sparkline1").sparkline([34, 43, 43, 35, 44, 32, 44, 52], {
        type: 'line',
        width: '100%',
        height: '60',
        lineColor: '#1ab394',
        fillColor: "#ffffff"
    });

    $("#sparkline2").sparkline([24, 43, 43, 55, 44, 62, 44, 72], {
        type: 'line',
        width: '100%',
        height: '60',
        lineColor: '#1ab394',
        fillColor: "#ffffff"
    });

    $("#sparkline3").sparkline([74, 43, 23, 55, 54, 32, 24, 12], {
        type: 'line',
        width: '100%',
        height: '60',
        lineColor: '#ed5565',
        fillColor: "#ffffff"
    });

    $("#sparkline4").sparkline([24, 43, 33, 55, 64, 72, 44, 22], {
        type: 'line',
        width: '100%',
        height: '60',
        lineColor: '#ed5565',
        fillColor: "#ffffff"
    });

    $("#sparkline5").sparkline([1, 4, 5], {
        type: 'pie',
        height: '140',
        sliceColors: ['#1ab394', '#F5F5F5','#ed5565']
    });

    $("#sparkline7").sparkline([1,2,2], {
        type: 'pie',
        height: '140',
        sliceColors: ['#1ab394', '#F5F5F5', '#ed5565']
    });

    $("#sparkline6").sparkline([2, 2], {
        type: 'pie',
        height: '140',
        sliceColors: ['#ed5565', '#F5F5F5']
    });

    $("#sparkline8").sparkline([2, 3], {
        type: 'pie',
        height: '140',
        sliceColors: ['#ed5565', '#F5F5F5']
    });


});